package com.gurkensalat.ebooks.ebookmarksync.aldiko;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class AttemptSyncReceiver extends BroadcastReceiver
{
	@Override
	public void onReceive(final Context context, final Intent intent)
	{
		Log.i(Constants.LOG_TAG, "onReceive - AttemptSyncReceiver");
		if (Constants.ACTION_ATTEMPT_SYNC.equals(intent.getAction()))
		{
			Log.i(Constants.LOG_TAG, "  GOT THE INTENT");

			Intent activityIntent = new Intent();
			activityIntent.setClass(context, AttemptSyncActivity.class);
			activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			if (intent.getExtras() != null)
			{
				activityIntent.putExtras(intent.getExtras());
			}

			context.startActivity(activityIntent);
		}
	}
}
